package cla;

import sun.util.resources.LocaleData;

import java.time.LocalDate;
import java.util.Date;

public class A1 {
    public static void main(String[] args) {
        Date date = new Date();
        System.out.println(date);
        //自定义值获取年月日
        LocalDate localDate =LocalDate.of(1999,3,3);
        System.out.println(localDate.getYear());
        //增加1000天
        LocalDate localDate1 = localDate.plusDays(2222);
        System.out.println(localDate1.getYear());
        A[] a = new A[3];
        a[0] = new A("1");
        String str = "96249fd4afdba59e929b33a2d31181f1";
        String str1 ="admin";
        byte[] bytes = hexToByteArray(str);
        System.out.println(new String(bytes));
        System.out.println(str1.hashCode());
    }

    public static byte hexToByte(String inHex){
        return (byte)Integer.parseInt(inHex,16);
    }
    public static byte[] hexToByteArray(String inHex){
        int hexlen = inHex.length();
        byte[] result;
        if (hexlen % 2 == 1){
            //奇数
            hexlen++;
            result = new byte[(hexlen/2)];
            inHex="0"+inHex;
        }else {
            //偶数
            result = new byte[(hexlen/2)];
        }
        int j=0;
        for (int i = 0; i < hexlen; i+=2){
            result[j]=hexToByte(inHex.substring(i,i+2));
            j++;
        }
        return result;
    }

}
class A{
    public A(String name){
        System.out.println(name);
    }
}
